import config from '../../utils/config';
import apiCreator from '../../utils/apiCreator';

const api = apiCreator();

export default {
  //簿记修改新增
  tradeBookSave: (query) => api.post(`${config.interfaces.type1}etfTrade/saveEtfInstruction2`, query),
  // //指令下达或新增
  orderSave: (query) => api.post(`${config.interfaces.type1}etfTrade/saveEtfInstruction`, query),
  //基本信息
  getBaseInfo: (query) => api.get(`${config.interfaces.type1}etfTrade/queryOneFnd`, query),
  //资管环境基本信息
  getBaseInfoWithMAAT: (query) => api.get(`maat/${config.interfaces.type1}etfTrade/queryOneFnd`, query),
  //资金可用信息
  getFund: (query) => api.get(`${config.interfaces.type1}fundAccount/queryFund`, query),
  //资金可用信息 股指期货
  getFundStockIndex: (query) => api.get(`${config.interfaces.type5}inventoryManagement-server/api/v2/inventory/management/financing/queryFutFinancing`, query),
  //资管环境资金可用
  getFundWithMAAT: (query) => api.get(`maat/${config.interfaces.type1}fundAccount/queryFund`, query),
  // 根据productGroupId（产品组id）查询资金可用信息
  getFundByProductGroupId: (query) => api.get(`${config.interfaces.type5}inventoryManagement-server/api/v2/inventory/management/financing/queryMultipleByCodeList`, query),
  //持仓可用信息
  getPosition: (query) => api.get(`${config.interfaces.type5}inventoryManagement-server/api/v2/inventory/management/holdInfo/queryPositong`, query),
  //持仓可用信息 股指期货
  getPositionStockIndex: (query) => api.get(`${config.interfaces.type5}inventoryManagement-server/api/v2/inventory/management/holdInfo/queryFutHold`, query),
  //资管环境持仓
  getPositionWithMAAT: (query) => api.get(`maat/${config.interfaces.type5}inventoryManagement-server/api/v2/inventory/management/holdInfo/queryPositong`, query),
  // 根据productGroupId（产品组id）查询持仓可用信息
  getPositionByProductGroupId: (query) =>
    api.get(`${config.interfaces.type5}inventoryManagement-server/api/v2/inventory/management/holdInfo/queryHoldqueryPositongByCodeList`, query),
  //申购信息
  getStockInfo: (query) => api.get(`${config.interfaces.type1}etfTrade/queryCfg`, query),
  //资管申购
  getStockInfoWithMAAT: (query) => api.get(`maat/${config.interfaces.type1}etfTrade/queryCfg`, query),
  //过去ETF标的当日涨停价
  getHardenPrice: (query) => api.get(`${config.interfaces.type1}bondTrade/getEtfPrice`, query),
  //资管过去ETF标的当日涨停价
  getHardenPriceZG: (query) => api.get(`maat/${config.interfaces.type1}bondTrade/getEtfHighLimit`, query),
};
